package com.ruoyi.web.domain;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;

public class DeviceStatusEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    private String Device;
    private String BatchNo;
    private String ProductionNo;
    private String ProgramName;
    private String ProcessNo;
    private String DeviceStatus;

    public void setDevice(String Device) {
        this.Device = Device;
    }

    /**
     * 传参时Jackson会将参数首字母小写，可以通过注解指定大写
     */
    @JsonProperty("Device")
    public String getDevice() {
        return this.Device;
    }

    public void setBatchNo(String BatchNo) {
        this.BatchNo = BatchNo;
    }

    @JsonProperty("BatchNo")
    public String getBatchNo() {
        return this.BatchNo;
    }

    public void setProductionNo(String ProductionNo) {
        this.ProductionNo = ProductionNo;
    }

    @JsonProperty("ProductionNo")
    public String getProductionNo() {
        return this.ProductionNo;
    }

    public void setProgramName(String ProgramName) {
        this.ProgramName = ProgramName;
    }

    @JsonProperty("ProgramName")
    public String getProgramName() {
        return this.ProgramName;
    }

    public void setProcessNo(String ProcessNo) {
        this.ProcessNo = ProcessNo;
    }

    @JsonProperty("ProcessNo")
    public String getProcessNo() {
        return this.ProcessNo;
    }

    public void setDeviceStatus(String DeviceStatus) {
        this.DeviceStatus = DeviceStatus;
    }

    @JsonProperty("DeviceStatus")
    public String getDeviceStatus() {
        return this.DeviceStatus;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
                .append("Device", getDevice())
                .append("BatchNo", getBatchNo())
                .append("ProductionNo", getProductionNo())
                .append("ProductionName", getProgramName())
                .append("ProcessNo", getProcessNo())
                .append("DeviceStatus", getDeviceStatus())
                .toString();
    }

    public JSONObject toJson() {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("Device", this.Device);
        jsonObject.put("BatchNo", this.BatchNo);
        jsonObject.put("ProductionNo", this.ProductionNo);
        jsonObject.put("ProgramName", this.ProgramName);
        jsonObject.put("ProcessNo", this.ProcessNo);
        jsonObject.put("DeviceStatus", this.DeviceStatus);
        return jsonObject;
    }

    public Boolean isFull() {
        return this.Device != null & this.BatchNo != null & this.ProductionNo != null & this.ProgramName != null & this.ProcessNo != null & this.DeviceStatus != null;
    }

    public static DeviceStatusEntity example() {
        DeviceStatusEntity entity = new DeviceStatusEntity();
        entity.setDevice("DRILL");
        entity.setBatchNo("1-1");
        entity.setProductionNo("A1");
        entity.setProgramName("A1_Drill");
        entity.setProcessNo("1");
        entity.setDeviceStatus("Processing");
        return entity;
    }
}
